home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / cert / trk3_eg / fmdrgdrp / opt2 / invent.exe / PARTS.BAS < prev    next >
Encoding:
BASIC Source File  |  1993-08-20  |  1.0 KB  |  44 lines

  1. 'Array to hold parts forms
  2. Const MAX_PARTS = 3
  3. Global PartsFormItems(MAX_PARTS) As FormItem
  4. Global PartsForms(MAX_PARTS) As PartsForm
  5.  
  6. ' Array describing parts schema
  7.  
  8. Global PartsSchema() As TABLESCHEMA
  9.  
  10. Sub InitParts ()
  11.     FormInit PartsFormItems()
  12.  
  13.     ' Initialize the schema for the parts database
  14.  
  15.     ReDim PartsSchema(3)
  16.  
  17.     PartsSchema(1).tsName = "PartNo"
  18.     PartsSchema(1).tsType = DB_LONG
  19.  
  20.     PartsSchema(2).tsName = "Description"
  21.     PartsSchema(2).tsType = DB_TEXT
  22.     PartsSchema(2).tsSize = 80
  23.  
  24.     PartsSchema(3).tsName = "Price"
  25.     PartsSchema(3).tsType = DB_CURRENCY
  26.  
  27. End Sub
  28.  
  29. Sub PartsOpen (fname As String, tbname As String)
  30.     If Not FormAvail(PartsFormItems()) Then
  31.     MsgBox "Cannot open more parts forms"
  32.     Exit Sub
  33.     End If
  34.     
  35.     i% = FormAlloc(PartsFormItems())
  36.     PartsFormItems(i%).fiFileName = fname
  37.     PartsFormItems(i%).fiTable = tbname
  38.  
  39.     Set PartsForms(i%) = New PartsForm
  40.     PartsForms(i%).Show
  41.     PartsForms(i%).Caption = "[" + ExtractBase(fname) + "]" + TnameDisp(tbname)
  42. End Sub
  43.  
  44.